<?php
// This is the login API call used to login a user to the mobile app. 
// uncomment for debugging
require '../../../../config/standard/config.php';
include '../../../RestRequest.php';
include '../../../RestUtils.php';
include '../../../MobileConfig.php';
require '../../../include/functions.php';

 
  
$data = RestUtils::processRequest();

switch($data->getMethod())
{
     
    case 'get':	    
        
        $requestVars = $data->getRequestVars();
        $type = getResponseType($requestVars['type']);
             
        $response = addMilestone($con,$db_name,$requestVars,$sessionEnabled, $type);      
       
        if($type == 'json')
        {
            RestUtils::sendResponse(200,$response,'application/json');
        }
        else if ($type == 'xml') 
        {
            RestUtils::sendResponse(200,$response,'text/xml');             
        }
    break;
    case 'post':
                
        $requestVars = $data->getRequestVars();
        $type = getResponseType($requestVars['type']);
             
        $response = addMilestone($con,$db_name,$requestVars,$sessionEnabled, $type);      
       
        if($type == 'json')
        {
            RestUtils::sendResponse(200,$response,'application/json');
        }
        else if ($type == 'xml') 
        {
            RestUtils::sendResponse(200,$response,'text/xml');             
        }
    break;
  
}

?>